<?php
/**
 * Template Name: Listings - Signature - Detail
 * Description: The detail page for Signature Listings
 *
 * @package ManterRealty
 * 
 */

get_header(); ?>
		
        <div class="listings_wrap signature_listings_wrap signature_listings_detail_wrap">
        	<?php if ( have_posts() ) : ?>
            	<?php while ( have_posts() ) : the_post(); ?>
					<?php 
						// Signature Listings Page URL
						$link = get_permalink($page->ID); 
						
						// Signature Listings Page Parent
						$parentID = get_permalink($post->post_parent); 
						$parentPage = get_page($post->post_parent);
						$parentLink = get_permalink($parentPage->ID);
						$parentTitle = get_the_title($parentPage->ID);
						
						// Signature Listing Detail Images
						
						$vals = get_post_custom_values('detail_image_1',$page->ID);
						$detailImageArray1 = wp_get_attachment_image_src($vals[0], 'full');
						$detailImage1 = $detailImageArray1[0];
						
						$vals = get_post_custom_values('detail_image_2',$page->ID);
						$detailImageArray2 = wp_get_attachment_image_src($vals[0], 'full');
						$detailImage2 = $detailImageArray2[0];
						
						$vals = get_post_custom_values('detail_image_3',$page->ID);
						$detailImageArray3 = wp_get_attachment_image_src($vals[0], 'full');
						$detailImage3 = $detailImageArray3[0];
						
						$vals = get_post_custom_values('detail_image_4',$page->ID);
						$detailImageArray41 = wp_get_attachment_image_src($vals[0], 'full');
						$detailImage4 = $detailImageArray4[0];
						
						$vals = get_post_custom_values('detail_image_5',$page->ID);
						$detailImageArray5 = wp_get_attachment_image_src($vals[0], 'full');
						$detailImage5 = $detailImageArray5[0];
						
						$vals = get_post_custom_values('detail_image_6',$page->ID);
						$detailImageArray6 = wp_get_attachment_image_src($vals[0], 'full');
						$detailImage6 = $detailImageArray6[0];
						
						$vals = get_post_custom_values('detail_image_7',$page->ID);
						$detailImageArray7 = wp_get_attachment_image_src($vals[0], 'full');
						$detailImage7 = $detailImageArray7[0];
						
						$vals = get_post_custom_values('detail_image_8',$page->ID);
						$detailImageArray8 = wp_get_attachment_image_src($vals[0], 'full');
						$detailImage8 = $detailImageArray8[0];

						$vals = get_post_custom_values('detail_image_9',$page->ID);
						$detailImageArray9 = wp_get_attachment_image_src($vals[0], 'full');
						$detailImage9 = $detailImageArray9[0];
						
						$vals = get_post_custom_values('detail_image_10',$page->ID);
						$detailImageArray10 = wp_get_attachment_image_src($vals[0], 'full');
						$detailImage10 = $detailImageArray10[0];
						
						// Signature Listing MLS#
						$vals = get_post_custom_values('mls',$page->ID);
						$mls = $vals[0];
						
						// Signature Listing Status
						$vals = get_post_custom_values('status',$page->ID);
						$status = $vals[0];
						
						// Signature Listing Price
						$vals = get_post_custom_values('price',$page->ID);
						$price = $vals[0];
						
						// Signature Listing Number of Bedrooms
						$vals = get_post_custom_values('number_of_bedrooms',$page->ID);
						$number_of_bedrooms = $vals[0];
						
						// Signature Listing Number of Bathrooms
						$vals = get_post_custom_values('number_of_bathrooms',$page->ID);
						$number_of_bathrooms = $vals[0];
						
						// Signature Listing Number of Rooms
						$vals = get_post_custom_values('number_of_rooms',$page->ID);
						$number_of_rooms = $vals[0];
						
						// Signature Listing Acres
						$vals = get_post_custom_values('number_of_acres',$page->ID);
						$number_of_acres = $vals[0];
						
						// Signature Listing Sq. Feet
						$vals = get_post_custom_values('square_feet',$page->ID);
						$square_feet= $vals[0];
						
						// Signature Listing Lot Size
						$vals = get_post_custom_values('lot_size',$page->ID);
						$lot_size= $vals[0];
						
						// Signature Listing Area
						$vals = get_post_custom_values('area',$page->ID);
						$area = $vals[0];
						
						// Signature Listing Location
						$vals = get_post_custom_values('location',$page->ID);
						$location = $vals[0];
						
						// Signature Listing Google Map
						$vals = get_post_custom_values('google_map',$page->ID);
						$googleMap = $vals[0];
						
						// Signature Listing Cooling
						$vals = get_post_custom_values('cooling',$page->ID);
						$cooling = $vals[0];
						
						// Signature Listing Heating
						$vals = get_post_custom_values('heating',$page->ID);
						$heating = $vals[0];
						
						// Signature Listing Interior
						$vals = get_post_custom_values('interior',$page->ID);
						$interior = $vals[0];
						
						// Signature Listing Founation
						$vals = get_post_custom_values('foundation',$page->ID);
						$foundation = $vals[0];
						
						// Signature Listing Roof
						$vals = get_post_custom_values('roof',$page->ID);
						$roof = $vals[0];
						
						// Signature Listing Construction
						$vals = get_post_custom_values('construction',$page->ID);
						$construction = $vals[0];
						
						// Signature Listing Style
						$vals = get_post_custom_values('style',$page->ID);
						$style = $vals[0];
						
						// Signature Listing Year Built
						$vals = get_post_custom_values('year_built',$page->ID);
						$year_built = $vals[0];
						
						// Signature Listing Rooms (Detail)
						$vals = get_post_custom_values('rooms',$page->ID);
						$rooms = $vals[0];
						
						// Signature Listing Bedroom (Detail)
						$vals = get_post_custom_values('bedroom',$page->ID);
						$bedroom = $vals[0];
						
						// Signature Listing Dining ROom (Detail)
						$vals = get_post_custom_values('dining_room',$page->ID);
						$dining_room = $vals[0];
						
						// Signature Listing Kitchen (Detail)
						$vals = get_post_custom_values('kitchen',$page->ID);
						$kitchen = $vals[0];
						
						// Signature Listing Basement
						$vals = get_post_custom_values('basement',$page->ID);
						$basement = $vals[0];
						
						// Signature Listing Laundry
						$vals = get_post_custom_values('laundry',$page->ID);
						$laundry = $vals[0];
						
						// Signature Listing Appliance
						$vals = get_post_custom_values('appliance',$page->ID);
						$appliance = $vals[0];
						
						// Signature Listing Utilities
						$vals = get_post_custom_values('utilities',$page->ID);
						$utilities = $vals[0];
						
						// Signature Listing Water
						$vals = get_post_custom_values('water',$page->ID);
						$water = $vals[0];
						
						// Signature Listing Sewer
						$vals = get_post_custom_values('sewer',$page->ID);
						$sewer = $vals[0];
						
						// Signature Listing Road
						$vals = get_post_custom_values('road',$page->ID);
						$road = $vals[0];
						
						// Signature Listing Zone
						$vals = get_post_custom_values('zone',$page->ID);
						$zone = $vals[0];
						
						// Signature Listing Neighborhood Data
						$vals = get_post_custom_values('neighborhood_data',$page->ID);
						$neighborhood_data = $vals[0];
						
						// Signature Listing School District Data
						$vals = get_post_custom_values('school_district_data',$page->ID);
						$school_district_data = $vals[0];
						
						// Signature Listing Has Calculator
						$vals = get_post_custom_values('has_calculator',$page->ID);
						$has_calculator = $vals[0];
						
						// Signature Listing calculator_value_1
						$vals = get_post_custom_values('calculator_value_1',$page->ID);
						$calculator_value_1 = $vals[0];
						
						// Signature Listing calculator_value_2
						$vals = get_post_custom_values('calculator_value_2',$page->ID);
						$calculator_value_2 = $vals[0];
						
						// Signature Listing calculator_value_3
						$vals = get_post_custom_values('calculator_value_3',$page->ID);
						$calculator_value_3 = $vals[0];
						
						// Signature Listing calculator_value_4
						$vals = get_post_custom_values('calculator_value_4',$page->ID);
						$calculator_value_4 = $vals[0];
						
					?>
                    	<div class="googlemap">
							<?php echo('<a href="'.$googleMap.'" title="Opens in new window" target="_blank">View Google Map</a>'); ?>
                        </div>
                        <h1><?php the_title(); ?></h1>
                        <div class="sig_list_detail_item">
                        	<div class="sig_list_detail_pad">
                            	<div class="sig_list_detail_head detail_head clearfix">
                                    <span class="back"><?php echo('<a href="'.$parentLink.'" title="Back to '.$parentTitle.'">Back to '.$parentTitle.'</a>'); ?></span>
                                    <span class="printer_friendly">
                                        <a href="#printer_friendly" title="Printer Friendly Version">Printer Friendly</a>
                                    </span>
                                    <span class="bookmark">
                                        <a href="#add_to_bookmarks" title="Signature Listing - <?php the_title(); ?>">Bookmark</a>
                                    </span>
                                </div>
                                <div class="sig_list_detail_content">
                                	<?php //Signature Slider ?>
                                	<div class="slider_wrap">
                                    	<ul class="slider clearfix" id="SignatureDetailSlider">
                                    		<?php if($detailImage1) { echo('<li><img src="'.$detailImage1.'" /></li>'); } ?>
                                            <?php if($detailImage2) { echo('<li><img src="'.$detailImage2.'" /></li>'); } ?>
                                            <?php if($detailImage3) { echo('<li><img src="'.$detailImage3.'" /></li>'); } ?>
                                            <?php if($detailImage4) { echo('<li><img src="'.$detailImage4.'" /></li>'); } ?>
                                            <?php if($detailImage5) { echo('<li><img src="'.$detailImage5.'" /></li>'); } ?>
                                            <?php if($detailImage6) { echo('<li><img src="'.$detailImage6.'" /></li>'); } ?>
                                            <?php if($detailImage7) { echo('<li><img src="'.$detailImage7.'" /></li>'); } ?>
                                            <?php if($detailImage8) { echo('<li><img src="'.$detailImage8.'" /></li>'); } ?>
                                            <?php if($detailImage9) { echo('<li><img src="'.$detailImage9.'" /></li>'); } ?>
                                            <?php if($detailImage10) { echo('<li><img src="'.$detailImage10.'" /></li>'); } ?>
                                        </ul>
                                    </div>
                                    <div class="slider_nav clearfix" id="SignatureDetailSliderNav"></div>
                                    
                                    <?php //Signature Calculator ?>
                                    <?php if($has_calculator) { ?>
                                    <div class="sig_list_detail_calc">
                                    	<p>This calculator can be hidden in the admin tool</p>
                                    	<?php if($calculator_value_1) { echo('<span class="sig_data_label">calculator_value_1:</span><span class="sig_data">'.$calculator_value_1.'</span>'); } ?>
										<?php if($calculator_value_2) { echo('<span class="sig_data_label">calculator_value_2:</span><span class="sig_data">'.$calculator_value_2.'</span>'); } ?>
                                        <?php if($calculator_value_3) { echo('<span class="sig_data_label">calculator_value_3:</span><span class="sig_data">'.$calculator_value_3.'</span>'); } ?>
                                        <?php if($calculator_value_4) { echo('<span class="sig_data_label">calculator_value_4:</span><span class="sig_data">'.$calculator_value_4.'</span>'); } ?>
                                    </div>
                                    <?php } ?>
                                    
                                    
                                    <?php //Signature Content ?>
                                    <div class="page_content">
                                    	<?php echo (apply_filters('the_content', $post->post_content)); ?>
                                    </div>
                                </div>
                                <div class="sig_list_detail_data clearfix">
                                    	<ul>
                                        	<?php if($status) { echo('<li><span class="sig_data_label">Status:</span><span class="sig_data">'.$status.'</span></li>'); } ?>
                                        	<?php if($price) { echo('<li><span class="sig_data_label">Price:</span><span class="sig_data">'.$price.'</span></li>'); } ?>
                                        	<?php if($mls) { echo('<li><span class="sig_data_label">MLS#:</span><span class="sig_data">'.$mls.'</span></li>'); } ?>
                                        	<?php if($number_of_bedrooms) { echo('<li><span class="sig_data_label"># Bedrooms:</span><span class="sig_data">'.$number_of_bedrooms.'</span></li>'); } ?>
                                        	<?php if($number_of_bathrooms) { echo('<li><span class="sig_data_label"># Bathrooms:</span><span class="sig_data">'.$number_of_bathrooms.'</span></li>'); } ?>
                                        	<?php if($number_of_rooms) { echo('<li><span class="sig_data_label"># Rooms:</span><span class="sig_data">'.$number_of_rooms.'</span></li>'); } ?>
                                        	<?php if($number_of_acres) { echo('<li><span class="sig_data_label">Acres:</span><span class="sig_data">'.$number_of_acres.'</span></li>'); } ?>
                                        	<?php if($square_feet) { echo('<li><span class="sig_data_label">Square Feet:</span><span class="sig_data">'.$square_feet.'</span></li>'); } ?>
                                        	<?php if($lot_size) { echo('<li><span class="sig_data_label">Lot Size:</span><span class="sig_data">'.$lot_size.'</span></li>'); } ?>
                                        	<?php if($area) { echo('<li><span class="sig_data_label">Area:</span><span class="sig_data">'.$area.'</span></li>'); } ?>
                                        	<?php if($location) { echo('<li><span class="sig_data_label">Location:</span><span class="sig_data">'.$location.'</span></li>'); } ?>
                                        	<?php if($cooling) { echo('<li><span class="sig_data_label">Cooling:</span><span class="sig_data">'.$cooling.'</span></li>'); } ?>
                                        	<?php if($heating) { echo('<li><span class="sig_data_label">Heating:</span><span class="sig_data">'.$heating.'</span></li>'); } ?>
                                        	<?php if($interior) { echo('<li><span class="sig_data_label">Interior:</span><span class="sig_data">'.$interior.'</span></li>'); } ?>
                                        	<?php if($foundation) { echo('<li><span class="sig_data_label">Foundation:</span><span class="sig_data">'.$foundation.'</span></li>'); } ?>
                                        	<?php if($roof) { echo('<li><span class="sig_data_label">Roof:</span><span class="sig_data">'.$roof.'</span></li>'); } ?>
                                        	<?php if($construction) { echo('<li><span class="sig_data_label">Construction:</span><span class="sig_data">'.$construction.'</span></li>'); } ?>
                                        	<?php if($style) { echo('<li><span class="sig_data_label">Style:</span><span class="sig_data">'.$style.'</span></li>'); } ?>
                                        	<?php if($year_built) { echo('<li><span class="sig_data_label">Year Built:</span><span class="sig_data">'.$year_built.'</span></li>'); } ?>
                                        	<?php if($rooms) { echo('<li><span class="sig_data_label">Rooms:</span><span class="sig_data">'.$rooms.'</span></li>'); } ?>
                                        	<?php if($bedroom) { echo('<li><span class="sig_data_label">Bedroom:</span><span class="sig_data">'.$bedroom.'</span></li>'); } ?>
                                        	<?php if($dining_room) { echo('<li><span class="sig_data_label">Dining Room:</span><span class="sig_data">'.$dining_room.'</span></li>'); } ?>
                                        	<?php if($kitchen) { echo('<li><span class="sig_data_label">Kitchen:</span><span class="sig_data">'.$kitchen.'</span></li>'); } ?>
                                        	<?php if($basement) { echo('<li><span class="sig_data_label">Basement:</span><span class="sig_data">'.$basement.'</span></li>'); } ?>
                                        	<?php if($laundry) { echo('<li><span class="sig_data_label">Laundry:</span><span class="sig_data">'.$laundry.'</span></li>'); } ?>
                                        	<?php if($appliance) { echo('<li><span class="sig_data_label">Appliance:</span><span class="sig_data">'.$appliance.'</span></li>'); } ?>
                                        	<?php if($utilities) { echo('<li><span class="sig_data_label">Utilities:</span><span class="sig_data">'.$utilities.'</span></li>'); } ?>
                                        	<?php if($water) { echo('<li><span class="sig_data_label">Water:</span><span class="sig_data">'.$water.'</span></li>'); } ?>
                                        	<?php if($sewer) { echo('<li><span class="sig_data_label">Sewer:</span><span class="sig_data">'.$sewer.'</span></li>'); } ?>
                                        	<?php if($road) { echo('<li><span class="sig_data_label">Road:</span><span class="sig_data">'.$road.'</span></li>'); } ?>
                                        	<?php if($zone) { echo('<li><span class="sig_data_label">Zone:</span><span class="sig_data">'.$zone.'</span></li>'); } ?>
                                        	<?php if($neighborhood_data) { echo('<li><span class="sig_data_label">Neighborhood Data:</span><span class="sig_data">'.$neighborhood_data.'</span></li>'); } ?>
                                        	<?php if($school_district_data) { echo('<li><span class="sig_data_label">School District Data:</span><span class="sig_data">'.$school_district_data.'</span></li>'); } ?>
                                        	
                                        </ul>
                                    </div>
                            </div>
                        </div>
				<?php endwhile; ?>
             <?php endif; ?>
        </div>

<?php get_footer(); ?>